package com.springboot.wikiproject.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;

@ComponentScan(basePackages="com.springboot.wikiproject")
@SpringBootApplication
@Slf4j

public class WikiProjectApplication {

    public static void main(String[] args) {
//        SpringApplication.run(WikiProjectApplication.class, args);
        // 获取spring容器
        SpringApplication springApplication = new SpringApplication(WikiProjectApplication.class);
        // 获取端口号
        String prot = springApplication.run(args).getEnvironment().getProperty("server.port");
        //启动日志
        log.info("启动成功");
        // 打印项目地址
        log.info("http://localhost:/" + prot);
    }


}
